package com.servlet;

import com.Dao.AdminDao;
import com.bean.AdminBean;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.ArrayList;

@WebServlet(name = "SelectUserServlet", value = "/SelectUserServlet")
public class SelectUserServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        response.setContentType("text/html;charset=UTF-8");
        int tip = Integer.parseInt(request.getParameter("tip"));
        String userName = request.getParameter("username");
        AdminDao adminDao = new AdminDao();
        ArrayList<AdminBean> list2=adminDao.getList(userName);
        request.getSession().setAttribute("list2", list2);
        request.getRequestDispatcher("user_massage.jsp").forward(request, response);
    }
}
